<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>学生信息表</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      a {
        text-decoration: none;
        color: black;
      }
      .stu-info {
        width: 600px;
        margin: 50px auto;
        text-align: center;
      }
      table {
        margin-top: 20px;
        width: 600px;
        border-collapse: collapse;
      }
      table tr {
        height: 30px;
      }
      a{
        cursor: pointer;
      }
    </style>
  </head>
  <body>
    <div class="stu-info">
      <h1>学生信息表</h1>
      <table border="1px">
        <thead>
          <tr>
            <th>学号</th>
            <th>姓名</th>
            <th>家庭住址</th>
            <th>联系方式</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody id="stus">
          <tr>
            <td>001</td>
            <td>王大头</td>
            <td>河南</td>
            <td>13984720038232</td>
            <td><a href="javascript:void(0)">删除</a></td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
  <script src="../jquery.js"></script>
  <script src="./jquery.showdata.js"></script>
  <script>
    // $("#stus").showData() //未传参 为默认值
    // $("#stus").showData({url:"stu.json"})

    // 事件绑定  事件三要素：事件源(事件对象),事件名,(事件处理函数)
    $("#stus").showData({
      url:"stu.json",
      click:function(){
        console.log($(this).text());
      },
      mouseover:function(){
        $(this).css({
          color:"yellow",
          background:"olive"
        })
      },
      mouseout:function(){
        $(this).css({
          color:"#000",
          background:"#fff"
        })
      },
    })
  </script>
</html>
